package com.compass.mobile.ui.dialog

import AppManager
import android.view.Gravity
import android.view.LayoutInflater
import androidx.fragment.app.FragmentActivity
import com.compass.mobile.callback.OnCustomButtonClick
import com.compass.mobile.databinding.DialogAddPatientTipsBinding
import com.compass.mobile.framework.base.BaseDialog
import com.compass.mobile.framework.base.BaseDialogFragment
import com.compass.mobile.framework.ext.onClick
import com.compass.mobile.framework.utils.FocusViewUtils

/**
 * Description： 添加就诊人提示
 * Date:2024/6/19 16:30
 */
class AddPatientTipsDialog {
    class Builder(
        activity: FragmentActivity,
        private var phoneNumber: String,
        private var onBottomClick: OnCustomButtonClick
    ) : BaseDialogFragment.Builder<Builder>(activity) {

        private val mBinding: DialogAddPatientTipsBinding =
            DialogAddPatientTipsBinding.inflate(LayoutInflater.from(activity))

        init {
            setContentView(mBinding.root)
            setWidth((AppManager.getScreenHeightPx() * 0.6).toInt())
            setAnimStyle(BaseDialog.AnimStyle.DEFAULT)
            setGravity(Gravity.CENTER)
            initView()
        }

        private fun initView() {
            mBinding.tvLocalNumber.text= phoneNumber
            mBinding.llLocalNumber.onClick {
                onBottomClick.onButtonCallBack(1,"local")
                dismiss()
            }
            mBinding.llOtherNumber.onClick {
                onBottomClick.onButtonCallBack(2,"other")
                dismiss()
            }
            mBinding.llScanCode.onClick {
                onBottomClick.onButtonCallBack(3,"code")
                dismiss()
            }
        }


    }
}